
package com.insigma.business.qrcode.job.dto.request;

import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.insigma.business.qrcode.common.vo.BaseUpdateRequest;
import com.insigma.business.qrcode.job.dto.EducationInfoRequest;
import com.insigma.business.qrcode.job.dto.ExpectedInfoRequest;
import com.insigma.business.qrcode.job.dto.ProjectExperienceRequest;
import com.insigma.business.qrcode.job.dto.WorkExperienceRequest;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;
import java.util.List;


@Getter
@Setter
public class JobCandidateResumeUpdateRequest extends BaseUpdateRequest<String, String> {

    private static final long serialVersionUID = 1L;

    
    private String candidateId;

    
    private String name;

    
    private String avatar;
    
    private String email;

    private String mobile;

    private String workingYears;

    
    private String gender;

    
    private Date birthday;

    
    private String residentAddress;

    
    private String residentAdminAreaCode;

    
    private String rootAreaCode;

    
    private String rootAreaValue;

    
    private Date workStartYear;

    
    private String graduateSchoolDictCode;

    
    private String graduateSchool;

    
    private String majorDictCode;

    
    private String major;

    
    private String educationLevelDictCode;

    
    private String educationLevel;

    
    private String workStatus;

    
    private String maritalStatus;

    
    private String politicalOutlookDictCode;

    
    private String politicalOutlook;

    
    private String expectedSalary;

    
    private String expectedCity;

    
    private String expectedPositionTypeId;

    
    private String expectedPositionTypeName;

    
    private String expectedIndustryId;

    
    private String expectedIndustryName;

    
    private String dutyTime;

    
    private String positionType;

    
    private String selfEvaluation;

    
    private String workExperience;

    
    private String specialSkill;

    
    private String extraResumePath;

    
    private Boolean show;

    
    private String expectedInfo;

    
    private String projectExperience;

    
    private String educationInfo;

    
    private String nativePlace;

    
    private String politicsStatus;

    
    private String honor;

    
    private String certificate;

    private List<ExpectedInfoRequest> expectedDetail;

    private List<WorkExperienceRequest> workDetail;

    private List<ProjectExperienceRequest> projectDetail;

    private List<EducationInfoRequest> educationDetail;

    public void build() {
        if (!CollectionUtil.isEmpty(expectedDetail)) {
            ExpectedInfoRequest expectedInfoRequest = expectedDetail.get(0);
            expectedCity = expectedInfoRequest.getExpectedCity();
            expectedSalary = expectedInfoRequest.getExpectedSalary();
            expectedPositionTypeId = expectedInfoRequest.getExpectedPositionTypeId();
            expectedPositionTypeName = expectedInfoRequest.getExpectedPositionTypeName();
            expectedIndustryId = expectedInfoRequest.getExpectedIndustryId();
            expectedIndustryName = expectedInfoRequest.getExpectedIndustryName();

            expectedInfo = JSON.toJSONString(expectedDetail);
        }

        if (!CollectionUtil.isEmpty(workDetail)) {
            WorkExperienceRequest workExperienceRequest = workDetail.get(0);
            workStartYear = workExperienceRequest.getStartTime();
            workExperience = JSON.toJSONString(workDetail);
        }

        if (!CollectionUtil.isEmpty(projectDetail)) {
            projectExperience = JSON.toJSONString(projectDetail);
        }

        if (!CollectionUtil.isEmpty(educationDetail)) {
            educationInfo = JSON.toJSONString(educationDetail);
        }
    }
}
